package cn.xiaohuodui.form;

import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.util.HashMap;
import java.util.Map;

/**
 * Author :chenqisheng
 * Date   :15/3/17.
 */
@Data
public class PageForm extends AbstractUserForm {
    @NotNull
    @Min(0)
    protected int page = 1;
    @NotNull
    @Min(1)
    protected int size = 10;

    public Map toMap(){
        Map map = new HashMap();
        map.put("offset",(this.page-1)*this.size);
        map.put("limit",this.size);
        return map;}

}
